/*路由配置*/
App.config(["$stateProvider","$urlRouterProvider",routeFunction]);

function routeFunction($stateProvider,$urlRouterProvider){
	//其他页面
    $urlRouterProvider.otherwise("/");
    
    $stateProvider
    /********************************-----【后台信息】-----***********************/
    .state("userInfo",{	
        url:"/userInfo",
        templateUrl:"../backstage_info/user_info.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../backstage_info/user_info.js");
            }]
        } 
    })
    /********************************-----【商户管理】-----***********************/
    .state("accountManagement",{	
        url:"/accountManagement",
        templateUrl:"../user_management/account_management.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../user_management/account_management.js");
            }]
        } 
    })
    .state("addCount",{	
        url:"/addCount/:params",
        templateUrl:"../user_management/add_account.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../user_management/add_account.js");
            }]
        } 
    })
    /********************************-----【活动管理】-----***********************/
    //联单活动
    .state("unionOrderActivity",{	
        url:"/unionOrderActivity",
        templateUrl:"../activity_management/union_order_activity.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
            	 return $ocLazyLoad.load({
                 	files:[
                 	       	"../../js/copy/clipboard.min.js",
                 	       	"../activity_management/union_order_activity.js",
                 	       
                        ]
                 });
            }]
        } 
    })
    /*添加联单活动*/
    .state("addUnionOrderActivity",{	
        url:"/addUnionOrderActivity/:params",
        templateUrl:"../activity_management/add_union_order_activity.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../activity_management/add_union_order_activity.js");
            }]
        } 
    })
    //活动创建
	.state("activitySet",{
		url:"/activitySet",
		templateUrl:"../activity_management/activitySet.html",
	    resolve:{
	        deps:["$ocLazyLoad",function($ocLazyLoad){
	            return $ocLazyLoad.load("../activity_management/activitySet.js");
	        }]
	    } 
	})   
    //联单活动的审核
    .state("activityCheck",{	
        url:"/activityCheck",
        templateUrl:"../activity_management/activity_check.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../activity_management/activity_check.js");
            }]
        } 
    })
    //活动管理--查看
    .state("activityLook",{	
        url:"/activityLook/:params",
        templateUrl:"../activity_management/acitvity_look.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../activity_management/acitvity_look.js");
            }]
        } 
    })
    /********************************-----【活动评价】-----***********************/
    .state("activityEvaluation",{	
        url:"/activityEvaluation",
        templateUrl:"../activity_management/activity_evaluation.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../activity_management/activity_evaluation.js");
            }]
        } 
    })
    /********************************-----【图文活动】-----***********************/
    .state("articleActivity",{	
        url:"/articleActivity",
        templateUrl:"../activity_management/article_activity.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../activity_management/article_activity.js");
            }]
        } 
    })
    /********************************-----【卡券管理】-----***********************/
    .state("cardManagement",{	
        url:"/cardManagement",
        templateUrl:"../activity_management/card_management.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../activity_management/card_management.js");
            }]
        } 
    })
    /********************************-----【人员管理】-----***********************/
    .state("guiderManagement",{	
        url:"/guiderManagement",
        templateUrl:"../people_management/guider_management.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../people_management/guider_management.js");
            }]
        } 
    })
     /********************************-----【类型管理】-----***********************/
    .state("typeManagement",{	
        url:"/typeManagement",
        templateUrl:"../people_management/type_management.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../people_management/type_management.js");
            }]
        } 
    })
    /********************************-----【人员管理 - 设置任务】-----***********************/
    .state("setTask",{	
        url:"/setTask",
        templateUrl:"../people_management/task_set.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../people_management/task_set.js");
            }]
        } 
    })
    /********************************-----【人员管理 - 设置任务 - 任务列表】-----***********************/
    .state("taskList",{	
        url:"/taskList/:params",
        templateUrl:"../people_management/task_list.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../people_management/task_list.js");
            }]
        } 
    })
     /********************************-----【人员管理 - 推广数据】-----***********************/
    .state("generalizeData",{	
        url:"/generalizeData/:params",
        templateUrl:"../people_management/generalize_data.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../people_management/generalize_data.js");
            }]
        } 
    })  
    /********************************-----【人员管理 - 任务查看】-----***********************/
    .state("taskLook",{	
        url:"/taskLook/:params",
        templateUrl:"../people_management/task_look.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../people_management/task_look.js");
            }]
        } 
    })
    /********************************-----【产品管理】-----***********************/
    .state("productClass",{		//产品分类（开发者）
        url:"/productClass",
        templateUrl:"../product_management/product_class.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../product_management/product_class.js");
            }]
        } 
    })
    .state("productClassUser",{		//产品分类（用户）
        url:"/productClassUser",
        templateUrl:"../product_management/product_class_user.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../product_management/product_class_user.js");
            }]
        } 
    })
    .state("shopProduct",{	
        url:"/shopProduct",
        templateUrl:"../product_management/shop_product.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load({
                	files:[
    	       			   "../../plugins/fancyBox/source/fancybox.css",
    	       			   "../../plugins/fancyBox/source/fancybox.js",
    	       			   "../../plugins/fancyBox/lib/mousewheel-3.0.6.pack.js",
                           "../product_management/shop_product.js"
                       ]
                });
            }]
        } 
    })
    .state("warehouseProduct",{	
        url:"/warehouseProduct",
        templateUrl:"../product_management/warehouse_product.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load({
                	files:[
    	       			   "../../plugins/fancyBox/source/fancybox.css",
    	       			   "../../plugins/fancyBox/source/fancybox.js",
    	       			   "../../plugins/fancyBox/lib/mousewheel-3.0.6.pack.js",
                           "../product_management/warehouse_product.js"
                       ]
                });
            }]
        } 
    })
    .state("addProduct",{	
        url:"/addProduct/:params",
        templateUrl:"../product_management/add_product.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../product_management/add_product.js");
            }]
        } 
    })
    /********************************-----【礼品库管理】-----***********************/
    .state("giftLibrary",{	
        url:"/giftLibrary",
        templateUrl:"../gift_management/gift_library.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
            	return $ocLazyLoad.load({
                	files:[
    	       			   "../../plugins/fancyBox/source/fancybox.css",
    	       			   "../../plugins/fancyBox/source/fancybox.js",
    	       			   "../../plugins/fancyBox/lib/mousewheel-3.0.6.pack.js",
                           "../gift_management/gift_library.js"
                       ]
                });
            }]
        } 
    })
    /********************************-----【消费者管理】-----***********************/
    .state("customerList",{	
        url:"/customerList",
        templateUrl:"../customer_management/customer_list.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../customer_management/customer_list.js");
            }]
        } 
    })
    .state("sourceManagement",{	
        url:"/sourceManagement",
        templateUrl:"../customer_management/customer_source.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../customer_management/customer_source.js");
            }]
        } 
    })
    .state("pointList",{	
        url:"/pointList",
        templateUrl:"../customer_management/point_list.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../customer_management/point_list.js");
            }]
        } 
    })
    /********************************-----【新闻资讯】-----***********************/
    .state("newInformation",{	
        url:"/newInformation",
        templateUrl:"../news_management/news_information.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../news_management/news_information.js");
            }]
        } 
    })
  .state("evaluationManagement",{	//新闻资讯评论管理
        url:"/evaluationManagement",
        templateUrl:"../news_management/evaluation.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../news_management/evaluation.js");
            }]
        } 
    })
    /********************【订单详情】************************/
      .state("orderList",{	//产品订单
        url:"/orderList",
        templateUrl:"../order_management/order_list.html",
        resolve:{  
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../order_management/order_list.js");
            }]
        } 
    })
   /********************【订单详情 店铺权限下】************************/
      .state("orderListOther",{	//产品订单
        url:"/orderListOther",
        templateUrl:"../order_management/order_list_other.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../order_management/order_list_other.js");
            }]
        } 
    })
     .state("cardList",{	//卡券订单
        url:"/cardList",
        templateUrl:"../order_management/card_list.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../order_management/card_list.js");
            }]
        } 
    })
        /********************【界面管理】************************/
      .state("interfaceManagement",{	//界面管理
        url:"/interfaceManagement",
        templateUrl:"../interfaceManagement/interfaceManagement.html",
        resolve:{  
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../interfaceManagement/interfaceManagement.js");
            }]
        } 
    })
    /********************************-----【文章专辑】-----***********************/
    .state("albumManagement",{	//专辑管理
        url:"/albumManagement",
        templateUrl:"../album_management/album.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../album_management/album.js");
            }]
        } 
    })
   /********************************-----【小区数据池】-----***********************/
    .state("villageManagement",{	//小区列表
        url:"/villageManagement",
        templateUrl:"../villageManagement/villageManagement.html",
        resolve:{
            deps:["$ocLazyLoad",function($ocLazyLoad){
                return $ocLazyLoad.load("../villageManagement/villageManagement.js");
            }]
        } 
    })
};
